<template>
<div class="dashboard-container views-container">
    <div class="shop-header flex-row" style="margin-bottom:20px">
        <img :src="avatarLogo || `${require('@/assets/login/avatar.png')}`" alt="" class="shop-header-img">
        <div class="flex-row flex-align-c flex-justify-b" style="width:100%;">
            <div class="flex-row flex-align-c">
                <div class="flex-col flex-justify-c" style="margin-right:20px;">
                    <p class="shop-header-name orders-blue" style="margin-bottom:0;">{{categoryData.name}}</p>
                    <!-- <p class="shop-header-time orders-gray">有效期：2019-01-01至2019-05-05到期</p> -->
                </div>
                <div v-for="(item,index) in qrcodeType" :key="index" class="flex-col flex-justify-c">
                    <el-popover
                        v-if="categoryData[`${item.key}`] && categoryData[`${item.key}`]['open']"
                        placement="bottom"
                        width="200"
                        trigger="hover">
                        <div class="wlm-form" style="margin-bottom:0;">
                            <div class="wlm-form-content flex-col flex-align-c flex-justify-c" style="padding: 10px;">
                                <p style="color: #303133;font-size: 14px;line-height: 1;text-align: center;" :style="{'margin-bottom':`${!categoryData[`${item.key}`]['qrcode']?'0':'12px'}`}">{{!categoryData[`${item.key}`]['open'] ? '暂未开通' : !categoryData[`${item.key}`]['qrcode'] ? '暂未设置' : '二维码'}}</p>
                                <img v-if="Array.isArray(categoryData[`${item.key}`]['qrcode'])" :src="`${categoryData[`${item.key}`]['qrcode'][0]['file_path']}`" class="wlm-upload-img">
                                <img v-if="typeof categoryData[`${item.key}`]['qrcode'] === 'string' && !!categoryData[`${item.key}`]['qrcode']" :src="`${categoryData[`${item.key}`]['qrcode']}`" class="wlm-upload-img">
                            </div>
                        </div>
                        <p slot="reference" class="shop-header-name orders-blue" style="cursor:pointer;border-left:1px solid rgb(240, 240, 240);padding:0 20px;margin:0;"><img width="40" height="40" :src="item.default"></p>
                    </el-popover>
                </div>
            </div>
            <router-link v-if="categoryData['newCopy'] && categoryData['newCopy']['status']!== 0" class="wlm-text" tag="p" :to="{path:'/channel'}">
                <span class="pointer" style="font-size:16px;">发现新版本</span>
            </router-link>
        </div>
    </div>

    <div v-if="categoryData.agent_user==1 && categoryData.agent_user">
        <div class="dashboard-header">
        <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;padding:36px 0 20px 0;border-bottom:1px solid #f0f0f0;">
            <div class="flex-col flex-justify-c flex-align-c">
                <div class="item-title">总订单</div>
                <div class="item-num orders-red">
                    <span class="orders-blue" v-if="categoryData.order" style="font-size:28px;">{{categoryData.order.totalOrder}}</span>
                </div>
            </div>
        </div>
        <el-row type="flex">
            <!-- <el-col :span="6" class="flex-col flex-justify-c flex-align-c">
                <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;">
                    <div class="flex-col flex-justify-c flex-align-c">
                        <div class="item-title">总订单数</div>
                        <div class="item-num orders-red">
                            <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.totalOrder' :duration='3000'></countTo>
                        </div>
                    </div>
                </div>
            </el-col> -->
            <el-col :span="24">
                <div class="flex-col">
                    <el-row type="flex" class="flex-row flex-align-c flex-justify-a">
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">待付款订单</div>
                                    <div class="item-num">
                                        <span v-if="categoryData.order" style="font-size:22px;">{{categoryData.order.pendingPaymentOrder}}</span>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">待发货订单</div>
                                    <div class="item-num">
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.stayDeliverGoodsOrder' :duration='3000'></countTo> -->
                                        <router-link class="wlm-text" tag="span" :to="{path:'/orders/ordersExpressManagement', query :{ order_status:2}}">
                                            <span v-if="categoryData.order" class="pointer" style="font-size:22px;">{{categoryData.order.stayDeliverGoodsOrder}}</span>
                                        </router-link>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">待核销订单</div>
                                    <div class="item-num">
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.stayWriteOffOrder' :duration='3000'></countTo> -->
                                        <router-link class="wlm-text" tag="span" :to="{path:'/orders/ordersVerificationManagement', query :{ order_status:2}}">
                                            <el-button v-if="categoryData.order" type="text" style="font-size:22px;padding:0">{{categoryData.order.stayWriteOffOrder}}</el-button>
                                        </router-link>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">待自提订单</div>
                                    <div class="item-num">
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.staySelfMentionOrder' :duration='3000'></countTo> -->
                                        <router-link class="wlm-text" tag="span" :to="{path:'/orders/ordersComeStoreManagement', query :{ order_status:2}}">
                                            <el-button v-if="categoryData.order" type="text" style="font-size:22px;padding:0">{{categoryData.order.staySelfMentionOrder}}</el-button>
                                        </router-link>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">待售后订单</div>
                                    <div class="item-num">
                                        <router-link class="wlm-text" tag="span" :to="{path:'/orders/afterSale', query :{ status:'1'}}">
                                            <el-button v-if="categoryData.order" type="text" style="font-size:22px;padding:0">{{categoryData.order.refundOrder}}</el-button>
                                        </router-link>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">今日订单数</div>
                                    <div class="item-num" style="font-size:22px;">
                                        <span v-if="categoryData.order">{{categoryData.order.todayOrder}}</span>
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.todayOrder' :duration='3000'></countTo> -->
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">昨日订单数</div>
                                    <div class="item-num" style="font-size:22px;">
                                        <span v-if="categoryData.order">{{categoryData.order.yesterdayOrder}}</span>
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.yesterdayOrder' :duration='3000'></countTo> -->
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">上月订单数</div>
                                    <div class="item-num" style="font-size:22px;">
                                        <span v-if="categoryData.order">{{categoryData.order.lastMonthOrder}}</span>
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.lastMonthOrder' :duration='3000'></countTo> -->
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">分销待提现数量</div>
                                     <router-link class="wlm-text" tag="span" :to="{path:'/application/withdrawalApplication'}">
                                            <el-button v-if="categoryData.order" type="text" style="font-size:22px;padding:0">{{categoryData.withdrawal.dealer}}</el-button>
                                        </router-link>
                                    <!-- <div class="item-num" style="font-size:22px;">
                                        <span v-if="categoryData.withdrawal">{{categoryData.withdrawal.dealer}}</span>
                                    </div> -->
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">商家待提现数量</div>
                                       <router-link class="wlm-text" tag="span" :to="{path:'/merchant/merchantWithdraw',query:{status:1}}">
                                            <el-button v-if="categoryData.order" type="text" style="font-size:22px;padding:0">{{categoryData.withdrawal.business}}</el-button>
                                        </router-link>
                                    <!-- <div class="item-num" style="font-size:22px;">
                                        <span v-if="categoryData.withdrawal">{{categoryData.withdrawal.business}}</span>
                                    </div> -->
                                </div>
                            </div>
                        </el-col>
                    </el-row>
                </div>
            </el-col>
        </el-row>
        </div>
        <el-row :gutter="30" style="margin-top:20px;">
            <el-col :md="12" v-if="categoryData.agent_user==1">
                <div class="dashboard-header">
                    <el-row>
                        <el-col :span="24" class="flex-col flex-justify-c flex-align-c">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c pad-40-30" style="width:100%;border-bottom:1px solid #f0f0f0;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">总成交额</div>
                                    <div class="item-num orders-red">
                                        <span v-if="categoryData.turnover" class="orders-blue" style="font-size:28px;">￥{{categoryData.turnover.sumTurnover}}</span>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                    </el-row>
                    <el-row>
                        <el-col :span="8" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="height:38px;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">今日成交额</div>
                                    <div class="item-num">
                                        <span v-if="categoryData.turnover">￥{{categoryData.turnover.todayTurnover}}</span>
                                        <!-- <countTo v-if="categoryData.turnover" :startVal='0' :endVal='categoryData.turnover.todayTurnover' :duration='3000'></countTo> -->
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="8" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="height:38px;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">昨日成交额</div>
                                    <div class="item-num" style="font-size:16px">
                                        <span v-if="categoryData.turnover">￥{{categoryData.turnover.yesterdayTurnover}}</span>
                                        <!-- <countTo v-if="categoryData.turnover" :startVal='0' :endVal='categoryData.turnover.yesterdayTurnover' :duration='3000'></countTo> -->
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="8" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;height:38px;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">上月成交额</div>
                                    <div class="item-num" style="font-size:16px">
                                        <span v-if="categoryData.turnover">￥{{categoryData.turnover.lastMonthTurnover}}</span>
                                        <!-- <countTo v-if="categoryData.turnover" :startVal='0' :endVal='categoryData.turnover.lastMonthTurnover' :duration='3000'></countTo> -->
                                    </div>
                                </div>
                            </div>
                        </el-col>
                    </el-row>
                </div>
            </el-col>
        </el-row>
    </div>

    <div v-else>
        <div class="dashboard-header">
        <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;padding:36px 0 20px 0;border-bottom:1px solid #f0f0f0;">
            <div class="flex-col flex-justify-c flex-align-c">
                <div class="item-title">总订单</div>
                <div class="item-num orders-red">
                    <span class="orders-blue" v-if="categoryData.order" style="font-size:28px;">{{categoryData.order.totalOrder}}</span>
                </div>
            </div>
        </div>
        <el-row type="flex">
            <!-- <el-col :span="6" class="flex-col flex-justify-c flex-align-c">
                <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;">
                    <div class="flex-col flex-justify-c flex-align-c">
                        <div class="item-title">总订单数</div>
                        <div class="item-num orders-red">
                            <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.totalOrder' :duration='3000'></countTo>
                        </div>
                    </div>
                </div>
            </el-col> -->
            <el-col :span="24">
                <div class="flex-col">
                    <el-row type="flex" class="flex-row flex-align-c flex-justify-a">
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">待付款订单</div>
                                    <div class="item-num">
                                        <span v-if="categoryData.order" style="font-size:22px;">{{categoryData.order.pendingPaymentOrder}}</span>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">待发货订单</div>
                                    <div class="item-num">
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.stayDeliverGoodsOrder' :duration='3000'></countTo> -->
                                        <router-link class="wlm-text" tag="span" :to="{path:'/orders/ordersExpressManagement', query :{ order_status:2}}">
                                            <span v-if="categoryData.order" class="pointer" style="font-size:22px;">{{categoryData.order.stayDeliverGoodsOrder}}</span>
                                        </router-link>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">待核销订单</div>
                                    <div class="item-num">
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.stayWriteOffOrder' :duration='3000'></countTo> -->
                                        <router-link class="wlm-text" tag="span" :to="{path:'/orders/ordersVerificationManagement', query :{ order_status:2}}">
                                            <el-button v-if="categoryData.order" type="text" style="font-size:22px;padding:0">{{categoryData.order.stayWriteOffOrder}}</el-button>
                                        </router-link>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">待自提订单</div>
                                    <div class="item-num">
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.staySelfMentionOrder' :duration='3000'></countTo> -->
                                        <router-link class="wlm-text" tag="span" :to="{path:'/orders/ordersComeStoreManagement', query :{ order_status:2}}">
                                            <el-button v-if="categoryData.order" type="text" style="font-size:22px;padding:0">{{categoryData.order.staySelfMentionOrder}}</el-button>
                                        </router-link>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">待售后订单</div>
                                    <div class="item-num">
                                        <router-link class="wlm-text" tag="span" :to="{path:'/orders/afterSale', query :{ status:'1'}}">
                                            <el-button v-if="categoryData.order" type="text" style="font-size:22px;padding:0">{{categoryData.order.refundOrder}}</el-button>
                                        </router-link>
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">今日订单数</div>
                                    <div class="item-num" style="font-size:22px;">
                                        <span v-if="categoryData.order">{{categoryData.order.todayOrder}}</span>
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.todayOrder' :duration='3000'></countTo> -->
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">昨日订单数</div>
                                    <div class="item-num" style="font-size:22px;">
                                        <span v-if="categoryData.order">{{categoryData.order.yesterdayOrder}}</span>
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.yesterdayOrder' :duration='3000'></countTo> -->
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">上月订单数</div>
                                    <div class="item-num" style="font-size:22px;">
                                        <span v-if="categoryData.order">{{categoryData.order.lastMonthOrder}}</span>
                                        <!-- <countTo v-if="categoryData.order" :startVal='0' :endVal='categoryData.order.lastMonthOrder' :duration='3000'></countTo> -->
                                    </div>
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">分销待提现数量</div>
                                     <router-link class="wlm-text" tag="span" :to="{path:'/application/withdrawalApplication'}">
                                            <el-button v-if="categoryData.order" type="text" style="font-size:22px;padding:0">{{categoryData.withdrawal.dealer}}</el-button>
                                        </router-link>
                                    <!-- <div class="item-num" style="font-size:22px;">
                                        <span v-if="categoryData.withdrawal">{{categoryData.withdrawal.dealer}}</span>
                                    </div> -->
                                </div>
                            </div>
                        </el-col>
                        <el-col :span="2" class="pad-30-0">
                            <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;">
                                <div class="flex-col flex-justify-c flex-align-c">
                                    <div class="item-title">商家待提现数量</div>
                                       <router-link class="wlm-text" tag="span" :to="{path:'/merchant/merchantWithdraw',query:{status:1}}">
                                            <el-button v-if="categoryData.order" type="text" style="font-size:22px;padding:0">{{categoryData.withdrawal.business}}</el-button>
                                        </router-link>
                                    <!-- <div class="item-num" style="font-size:22px;">
                                        <span v-if="categoryData.withdrawal">{{categoryData.withdrawal.business}}</span>
                                    </div> -->
                                </div>
                            </div>
                        </el-col>
                    </el-row>
                </div>
            </el-col>
        </el-row>
    </div>

    <el-row :gutter="30" style="margin-top:20px;">
        <el-col :md="12">
            <div class="dashboard-header">
                <el-row>
                    <el-col :span="24" class="flex-col flex-justify-c flex-align-c">
                        <div class="dashboard-header-item flex-col flex-justify-c flex-align-c pad-40-30" style="width:100%;border-bottom:1px solid #f0f0f0;">
                            <div class="flex-col flex-justify-c flex-align-c">
                                <div class="item-title">总成交额</div>
                                <div class="item-num orders-red">
                                    <span v-if="categoryData.turnover" class="orders-blue" style="font-size:28px;">￥{{categoryData.turnover.sumTurnover}}</span>
                                </div>
                            </div>
                        </div>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8" class="pad-30-0">
                        <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="height:38px;">
                            <div class="flex-col flex-justify-c flex-align-c">
                                <div class="item-title">今日成交额</div>
                                <div class="item-num">
                                    <span v-if="categoryData.turnover">￥{{categoryData.turnover.todayTurnover}}</span>
                                    <!-- <countTo v-if="categoryData.turnover" :startVal='0' :endVal='categoryData.turnover.todayTurnover' :duration='3000'></countTo> -->
                                </div>
                            </div>
                        </div>
                    </el-col>
                    <el-col :span="8" class="pad-30-0">
                        <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="height:38px;">
                            <div class="flex-col flex-justify-c flex-align-c">
                                <div class="item-title">昨日成交额</div>
                                <div class="item-num" style="font-size:16px">
                                    <span v-if="categoryData.turnover">￥{{categoryData.turnover.yesterdayTurnover}}</span>
                                    <!-- <countTo v-if="categoryData.turnover" :startVal='0' :endVal='categoryData.turnover.yesterdayTurnover' :duration='3000'></countTo> -->
                                </div>
                            </div>
                        </div>
                    </el-col>
                    <el-col :span="8" class="pad-30-0">
                        <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;height:38px;">
                            <div class="flex-col flex-justify-c flex-align-c">
                                <div class="item-title">上月成交额</div>
                                <div class="item-num" style="font-size:16px">
                                    <span v-if="categoryData.turnover">￥{{categoryData.turnover.lastMonthTurnover}}</span>
                                    <!-- <countTo v-if="categoryData.turnover" :startVal='0' :endVal='categoryData.turnover.lastMonthTurnover' :duration='3000'></countTo> -->
                                </div>
                            </div>
                        </div>
                    </el-col>
                </el-row>
            </div>
        </el-col>
        <el-col :md="12" >
            <div class="dashboard-header">
                <el-row>
                    <el-col :span="24" class="flex-col flex-justify-c flex-align-c">
                        <div class="dashboard-header-item flex-col flex-justify-c flex-align-c pad-40-30" style="width:100%;border-bottom:1px solid #f0f0f0;">
                            <div class="flex-col flex-justify-c flex-align-c">
                                <div class="item-title">总用户数</div>
                                <div class="item-num orders-red">
                                    <span v-if="categoryData.user" class="orders-blue" style="font-size:28px;">{{categoryData.user.sumUser}}</span>
                                </div>
                            </div>
                        </div>
                    </el-col>
                </el-row>
                <el-row>
                    <el-col :span="8" class="pad-30-0">
                        <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="height:38px;">
                            <div class="flex-col flex-justify-c flex-align-c">
                                <div class="item-title">今日新增用户</div>
                                <div class="item-num">
                                    <span v-if="categoryData.user">{{categoryData.user.todayUser}}</span>
                                    <!-- <countTo v-if="categoryData.user" :startVal='0' :endVal='categoryData.user.todayUser' :duration='3000'></countTo> -->
                                </div>
                            </div>
                        </div>
                    </el-col>
                    <el-col :span="8" class="pad-30-0">
                        <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="height:38px;">
                            <div class="flex-col flex-justify-c flex-align-c" tag="div">
                                <div class="item-title">昨日新增用户</div>
                                <div class="item-num" style="font-size:16px">
                                    <span v-if="categoryData.user">{{categoryData.user.yesterdayUser}}</span>
                                    <!-- <countTo v-if="categoryData.user" :startVal='0' :endVal='categoryData.user.yesterdayUser' :duration='3000'></countTo> -->
                                </div>
                            </div>
                        </div>
                    </el-col>
                    <el-col :span="8" class="pad-30-0">
                        <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="border-right:none;height:38px;">
                            <div class="flex-col flex-justify-c flex-align-c">
                                <div class="item-title">上月新增用户</div>
                                <div class="item-num" style="font-size:16px">
                                    <span v-if="categoryData.user">{{categoryData.user.lastMonthUser}}</span>
                                    <!-- <countTo v-if="categoryData.user" :startVal='0' :endVal='categoryData.user.lastMonthUser' :duration='3000'></countTo> -->
                                </div>
                            </div>
                        </div>
                    </el-col>
                </el-row>
            </div>
        </el-col>
    </el-row>
    <div class="home-form" style="margin-top:20px;">
        <div class="home-form-header flex-row flex-justify-b">
            <div class="home-form-header-left">常用功能</div>
        </div>
        <el-row>
            <el-col :span="4" class="flex-col flex-justify-c flex-align-c pad-40-50">
                <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;border-right:none;">
                    <router-link class="flex-row flex-justify-c flex-align-c pointer" tag="div" :to="{path:'/merchant/business'}">
                        <div class="item-num">
                            <span class="svg-container">
                                <svg-icon icon-class="merchant" />
                            </span>
                        </div>
                        <div class="application-title">商家管理</div>
                    </router-link>
                </div>
            </el-col>
            <el-col :span="4" class="flex-col flex-justify-c flex-align-c pad-40-50">
                <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;border-right:none;">
                    <router-link class="flex-row flex-justify-c flex-align-c pointer" tag="div" :to="{path:'/platform/renovationList'}">
                        <div class="item-num">
                            <span class="svg-container">
                                <svg-icon icon-class="decorate" />
                            </span>
                        </div>
                        <div class="application-title">店铺装修</div>
                    </router-link>
                </div>
            </el-col>
            <el-col :span="4" class="flex-col flex-justify-c flex-align-c pad-40-50">
                <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;border-right:none;">
                    <router-link class="flex-row flex-justify-c flex-align-c pointer" tag="div" :to="{path:'/merchandise/merchandiseManagement'}">
                        <div class="item-num">
                            <span class="svg-container">
                                <svg-icon icon-class="merchandise" />
                            </span>
                        </div>
                        <div class="application-title">发布商品</div>
                    </router-link>
                </div>
            </el-col>
            <el-col :span="4" class="flex-col flex-justify-c flex-align-c pad-40-50">
                <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;border-right:none;">
                    <router-link class="flex-row flex-justify-c flex-align-c pointer" tag="div" :to="{path:'/application/distributorMerchandise'}">
                        <div class="item-num">
                            <span class="svg-container">
                                <svg-icon icon-class="distribution" />
                            </span>
                        </div>
                        <div class="application-title">分销商品</div>
                    </router-link>
                </div>
            </el-col>
            <el-col :span="4" class="flex-col flex-justify-c flex-align-c pad-40-50">
                <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;border-right:none;">
                    <router-link class="flex-row flex-justify-c flex-align-c pointer" tag="div" :to="{path:'/orders/ordersVerificationManagement'}">
                        <div class="item-num">
                            <span class="svg-container">
                                <svg-icon icon-class="orders" />
                            </span>
                        </div>
                        <div class="application-title">订单管理</div>
                    </router-link>
                </div>
            </el-col>
            <el-col :span="4" class="flex-col flex-justify-c flex-align-c pad-40-50">
                <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;border-right:none;">
                    <router-link class="flex-row flex-justify-c flex-align-c pointer" tag="div" :to="{path:'/orders/afterSale'}">
                        <div class="item-num">
                            <span class="svg-container">
                                <svg-icon icon-class="activist" />
                            </span>
                        </div>
                        <div class="application-title">售后维权</div>
                    </router-link>
                </div>
            </el-col>
            <el-col :span="4" class="flex-col flex-justify-c flex-align-c pad-40-50">
                <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;border-right:none;">
                    <router-link class="flex-row flex-justify-c flex-align-c pointer" tag="div" :to="{path:'/channel/channelDisplay'}">
                        <div class="item-num">
                            <span class="svg-container">
                                <svg-icon icon-class="channel" />
                            </span>
                        </div>
                        <div class="application-title">渠道</div>
                    </router-link>
                </div>
            </el-col>
        </el-row>
    </div>
    <div class="home-form" style="margin-top:20px;">
        <div class="home-form-header flex-row flex-justify-b">
            <div class="home-form-header-left">营销应用</div>
        </div>
        <el-row>
            <el-col :span="4" class="flex-col flex-justify-c flex-align-c pad-40-50">
                <div class="dashboard-header-item flex-col flex-justify-c flex-align-c" style="width:100%;border-right:none;">
                    <router-link class="flex-row flex-justify-c flex-align-c pointer" tag="div" :to="{path:'/application/couponMarketing'}">
                        <div class="item-num">
                            <span class="svg-red">
                                <svg-icon icon-class="coupons"/>
                            </span>
                        </div>
                        <div class="application-title">优惠券管理</div>
                    </router-link>
                </div>
            </el-col>
        </el-row>
    </div>
    </div>
    
</div>
</template>
<script>
import {
  mapGetters
} from 'vuex'
import Vue from 'vue'
import gmap from '@/components/Amap/index'
import {
  getPlanTaskData
} from '@/api/setting'
import viserVue from 'viser-vue'
import countTo from 'vue-count-to'
import {
  getPlatformOverviewInfo
} from '@/api/charts'
import {
  synchronizationSql
} from '@/api/cloudservice'
import {
  kkk
} from '@/api/login'
import { setPath} from '@/utils/auth'

Vue.use(viserVue)

export default {
  name: 'DashboardAdmin',
  components: {
    countTo,
    gmap
  },
  computed: {
    ...mapGetters([
      'avatar',
      'independent',
      'agent_id'
    ]),
    avatarLogo() {
      return this.avatar
    },
    isIndependent() {
      return this.$store.getters.independent
    },
  },

  data() {
    return {
      qrcodeType: [
        {
          name: '公众号',
          key: 'wechat',
          default: require('@/assets/dashboard/dashbpard_wechat.png')
        },
        {
          name: '小程序',
          key: 'sapp',
          default: require('@/assets/dashboard/dashbpard_sapp.png')
        },
        {
          name: '支付宝',
          key: 'alipay',
          default: require('@/assets/dashboard/dashbpard_alipay.png')
        },
        {
          name: '百度',
          key: 'baidu',
          default: require('@/assets/dashboard/dashbpard_baidu.png')
        },
        {
          name: '头条',
          key: 'toutiao',
          default: require('@/assets/dashboard/dashbpard_toutiao.png')
        },
        {
          name: 'H5',
          key: 'h5',
          default: require('@/assets/dashboard/dashbpard_h5.png')
        }
      ],
      categoryData: {}
    }
  },
  created() {
     this.$nextTick(() => {
    //有aid和store_user_id才走agentManage接口
    if(this.$route.query.h_aid && this.$route.query.store_user_id){
        //解密
        let h_aid = this.$aes.decrypt(this.$route.query.h_aid)
        let store_user_id = this.$aes.decrypt(this.$route.query.store_user_id)
        console.log("||||||交话费靠的就是反倒是开发就",h_aid,store_user_id)
            if(h_aid && store_user_id){
                kkk({h_aid:h_aid,store_user_id:store_user_id}).then(res=>{
                    if(res.data.code==1){
                        //改变vuex里的ChangeRoles
                        // console.log("复合大师积分兑换是接口放到",res.data.data.)
                    this.$store.dispatch('ChangeRoles', {
                        roles: ["user"],
                        path: res.data.data
                    })
                    this.$store.commit('h_aid', h_aid)
                    }
                })
            }
    }
    getPlatformOverviewInfo().then((response) => {
      const {
        data: {
          data: msgData = []
        }
      } = response
      this.categoryData = msgData
    })
    console.log(window.location, 'this.window.location.host')
    if (window.location.host === 'zerodev.weliam.com.cn'|| window.location.host === 'zero.weliam.com.cn') {
      synchronizationSql().then((res) => {
        console.log(res)
      })
    }
     //如果是微擎版，就执行getPlanTaskData接口，如果第一个参数为false就跳转到计划任务页面
     console.log("0...........4444444444",this.independent)
   if(!this.independent){
     getPlanTaskData().then(res=>{
       if(res.data.data[0]==false){
        this.open()
       }
     })
   }
     })
  },
  mounted() {

  },
  methods: {
      //弹窗
     open() {
        this.$confirm('未配置计划任务，请前往配置?', '提示', {
          confirmButtonText: '确定',
          showClose:false,
          closeOnClickModal:false,
          showCancelButton:false,
          type: 'warning'
        }).then(() => {
            // this.$router.push({path:'/setting/renwuing'})
          this.$router.push({path:'/setting/renwuing'})
        })
      },
  }
}
</script>

<style lang="scss" scoped>
.dashboard-container {
    font-size: 14px;

    .color51 {
        color: rgb(51, 51, 51);
    }

    .shop-header {
        padding: 20px;
        background: #ffffff;
    }

    .svg-container svg {
        padding:10px;
        background:#409EFF;
        border-radius: 10px;
        fill: #ffffff;
        font-size: 50px;
    }
    .svg-red svg {
        padding:10px;
        // fill: #f85959;
        background:#f85959;
        border-radius: 10px;
        fill: #ffffff;
        font-size: 50px;
    }

    .shop-header-img {
        height: 55px;
        width: 55px;
        border-radius: 50%;
        margin-right: 20px;
    }

    .point {
        cursor: pointer;
    }

    .shop-header-time {
        font-size: 12px;
    }

    .shop-header-name {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .pad-30-0 {
        padding: 30px 0;
    }

    .pad-40-50 {
        padding: 40px 0 50px;
    }
    .pad-40-30{
        padding: 40px 0 30px;
    }
    .platform-title {
        font-size: 14px;
        font-weight: 600;
        display: inline-block;
        margin: 20px 0 30px 50px;
    }

    .dashboard-header {
        background: #ffffff;
    }
    .application-title{
        font-size: 14px;
        margin-left:8px;
        color:#333;
        width:120px;
    }
    .dashboard-header-item {
        .item-title {
            font-size: 14px;
            color: #5d5d5d;
            margin-bottom: 6px;
        }

        .item-num {
            font-size: 24px;
        }

        .item-num {
            font-size: 16px;
            // font-weight: 600;
            color: #333;
        }
    }

    .home-form {
        font-weight: 400;
        border-radius: 4px;
        margin-bottom: 20px;
        background: #ffffff;
        min-height: 200px;

        .el-date-editor {
            margin-left: 20px;
        }

        .home-form-header {
            padding: 20px;
            font-size: 14px;
            // border-bottom: 1px solid #f2f2f2;
            padding: 10px 20px;
        }

        .home-form-content {
            padding: 20px;
            overflow: hidden;
        }

        .home-form-header-left {
            line-height: 36px;
            font-weight: 600;
            font-size:16px;
        }
    }
}
</style>
